package me.zhengjie.exception;


public class RuleException extends RuntimeException{
    public RuleException(String field, String val) {
        super(RuleException.generateMessage(field, val));
    }
    public RuleException(String msg) {
        super(RuleException.simpleMessage(msg));
    }

    private static String generateMessage(String field, String val) {
        return "规则性错误: "
                + " with " + field + " "+ val + " does not illegal";
    }
    private static String simpleMessage(String msg) {
        return "规则性错误: " + msg;
    }
}
